package com.tengju.data.domain.model.report;

import com.tengju.data.domain.model.user.*;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.math.BigDecimal;

@Getter
@AllArgsConstructor
public class AchievementBonus {

    private UserIdCode idCode;

    private UserIdCode pIdCode;

    private UserIdCode settlePIdCode;

    private UserId userId;

    private UserId pUserId;

    private UserId settlePUserId;

    private Integer teamRatioType;

    private Double factor;

    private BigDecimal profit;

    private BigDecimal totalProfit;

    private Integer month;

    private BigDecimal smallTeamCancelBeforeAchievement;

    private BigDecimal allTeamCancelBeforeAchievement;

    private BigDecimal theoryAchievement;

    private BigDecimal achievement;

    private BigDecimal settleAchievement;

    private AchievementBonusStatusEnum status;

    private Integer starRole;

    private Integer starLevel;

    private String userTag;

    private Integer version;

    public AchievementBonus(UserLevelInfo user, Integer month, MarketAchievement.Achievement achievement, MarketAchievement.Bonus bonus, UserStarFeature starFeature, int version) {
        this.idCode = user.getIdCode();
        this.pIdCode = user.getPIdCode();
        this.settlePIdCode = bonus.getSettlePIdCode();
        this.userId = user.getUserId();
        this.pUserId = user.getPUserId();
        this.settlePUserId = bonus.getSettlePUserId();
        this.teamRatioType = achievement.getTeamRatioType();
        this.factor = bonus.getFactor();
        this.profit = bonus.getLeaderBonus();
        this.totalProfit = bonus.getTotalMarketBonus();
        this.month = month;
        this.smallTeamCancelBeforeAchievement = achievement.getSmallTeamCancelAchievement();
        this.allTeamCancelBeforeAchievement = achievement.getAllTeamCancelAchievement();
        this.theoryAchievement = achievement.getTheoryAchievement();
        this.achievement = achievement.getMarketIndex();
        this.settleAchievement = achievement.getSettleAchievement();
        this.status = bonus.getStatus();
        this.starRole = starFeature.getStarLevel().getStarRoleEnum().getCode();
        this.starLevel = starFeature.getStarLevel().getCode();
        this.userTag = starFeature.getTagDesc();
        this.version = version;
    }


}
